package com.masterrabbit.gyf.Utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class R {
    private int code;
    private String msg;
    private Object data;

    //操作成功
    public static R ok(Object data){
        return new R(200,"操作成功",data);
    }

    //操作失败
    public static R fail(String msg){
        return new R(500,msg,null);
    }

    //操作异常
    public static R error(String msg){
        return new R(600,msg,null);
    }
}
